class CmdHelper {
    private static readonly requestMap:Map<number,string>  = new Map()
    private static readonly broadcastMap:Map<number,string>  = new Map()
    private static readonly errorMap:Map<number,string>  = new Map()
    //TODO int好像不够
    //cmd = ver+module+method
    //0000 0000 0000 0000 0000 0000 0000 0000
    //获取版本
    static getVer(cmd) {
        return cmd >> 16;
    }
    //获取功能id
    static getFunc(cmd) {
        return cmd >> 16;
    }
    //获取请求的方法id
    static getMethod(cmdMerge) {
        return cmdMerge & 0xFFFF;
    }

    static getDetail(cmd) {
        let ver = this.getVer(cmd)
        let func = this.getFunc(cmd)
        let method = this.getMethod(cmd)
        //版本 功能 方法
        return `req:${ver}-${func}-${method}`;
    }
    static mappingRequest(cmd, desc) {
        this.requestMap.set(cmd, desc);
        return cmd;
    }
    // static mappingRequest(cmdMerge, title) {
    //     this.requestDictionary.add(cmdMerge, title);
    //     return cmdMerge;
    // }
    // static mappingBroadcast(cmdMerge, title) {
    //     this.broadcastDictionary.add(cmdMerge, title);
    //     return cmdMerge;
    // }
    // static mappingErrorCode(errorCode, title) {
    //     this.errorCodeDictionary.add(errorCode, title);
    //     return errorCode;
    // }
    // static getRequestTitle(cmdMerge) {
    //     return this.requestDictionary.get(cmdMerge);
    // }
    // static getBroadcastTitle(cmdMerge) {
    //     return this.broadcastDictionary.get(cmdMerge);
    // }
    // static getErrorCodeTitle(errorCode) {
    //     return this.errorCodeDictionary.get(errorCode);
    // }
}